<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage_Home_admin.master" AutoEventWireup="true" CodeFile="addcustomer.aspx.cs" Inherits="admin_addcustomer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
    .style2
    {
        height: 12px;
    }
    .style3
    {
        height: 26px;
            width: 148px;
        }
    .style4
    {
            height: 23px;
            width: 148px;
        }
        .style5
        {
            height: 26px;
            width: 469px;
        }
        .style6
        {
            width: 469px;
        }
        .style7
        {
            height: 23px;
            width: 469px;
        }
        .style8
        {
            width: 148px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="User_ID,Username" DataSourceID="SqlDataSource1" Height="181px" 
        Width="678px">
        <Columns>
            <asp:BoundField DataField="User_ID" HeaderText="User_ID" ReadOnly="True" 
                SortExpression="User_ID" Visible="False" />
            <asp:BoundField DataField="Username" HeaderText="Username" ReadOnly="True" 
                SortExpression="Username" />
            <asp:BoundField DataField="Password" HeaderText="Password" 
                SortExpression="Password" Visible="False" />
            <asp:BoundField DataField="Fullname" HeaderText="Fullname" 
                SortExpression="Fullname" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:CheckBoxField DataField="Gender" HeaderText="Gender" 
                SortExpression="Gender" />
            <asp:BoundField DataField="Birthdays" DataFormatString="{0:d}" 
                HeaderText="Birthdays" SortExpression="Birthdays" />
            <asp:BoundField DataField="PhoneNumber" HeaderText="PhoneNumber" 
                SortExpression="PhoneNumber" />
            <asp:BoundField DataField="Point" HeaderText="Point" SortExpression="Point" 
                Visible="False" />
            <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" 
                Visible="False" />
            <asp:BoundField DataField="GrantID" HeaderText="GrantID" 
                SortExpression="GrantID" Visible="False" />
            <asp:BoundField DataField="Address" HeaderText="Address" 
                SortExpression="Address" />
            <asp:CommandField ShowEditButton="True" />
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ShoppingOnlineConnectionString %>" 
        SelectCommand="SELECT * FROM [User]" 
        DeleteCommand="DELETE FROM [User] WHERE [User_ID] = @User_ID AND [Username] = @Username" 
        InsertCommand="INSERT INTO [User] ([User_ID], [Username], [Password], [Fullname], [Email], [Gender], [Birthdays], [PhoneNumber], [Point], [Status], [Image], [GrantID], [Address]) VALUES (@User_ID, @Username, @Password, @Fullname, @Email, @Gender, @Birthdays, @PhoneNumber, @Point, @Status, @Image, @GrantID, @Address)" 
        UpdateCommand="UPDATE [User] SET [Fullname] = @Fullname, [Email] = @Email, [Gender] = @Gender, [Birthdays] = @Birthdays, [PhoneNumber] = @PhoneNumber,[Address] = @Address WHERE [User_ID] = @User_ID AND [Username] = @Username">
        <DeleteParameters>
            <asp:Parameter Name="User_ID" Type="String" />
            <asp:Parameter Name="Username" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            
            <asp:Parameter Name="Fullname" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="Gender" Type="Boolean" />
            <asp:Parameter Name="Birthdays" Type="DateTime" />
            <asp:Parameter Name="PhoneNumber" Type="Int32" />
          
            
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="User_ID" Type="String" />
            <asp:Parameter Name="Username" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="User_ID" Type="String" />
            <asp:Parameter Name="Username" Type="String" />
            <asp:Parameter Name="Password" Type="String" />
            <asp:Parameter Name="Fullname" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="Gender" Type="Boolean" />
            <asp:Parameter Name="Birthdays" Type="DateTime" />
            <asp:Parameter Name="PhoneNumber" Type="Int32" />
            <asp:Parameter Name="Point" Type="Int32" />
            <asp:Parameter Name="Status" Type="String" />
            <asp:Parameter Name="Image" Type="Object" />
            <asp:Parameter Name="GrantID" Type="Int32" />
            <asp:Parameter Name="Address" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    <br />
    &nbsp;Gourp&nbsp;&nbsp;
    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
        <asp:ListItem Value="2">employees</asp:ListItem>
        <asp:ListItem Value="3">Customer</asp:ListItem>
</asp:DropDownList>
<table style="width:102%; height: 527px;">
    <tr>
        <td class="style2" colspan="2" align="center" bgcolor="#6666FF">
            Add User</td>
    </tr>
    <tr>
        <td class="style3">
            username</td>
        <td class="style5">
            <asp:TextBox ID="txtUser" runat="server" AutoPostBack="True" 
                ontextchanged="txtUser_TextChanged"></asp:TextBox>
            <asp:Label ID="lbUser" runat="server"></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style8">
            Password</td>
        <td class="style6">
            <asp:TextBox ID="txtPass1" runat="server" AutoPostBack="True" 
                ontextchanged="txtPass1_TextChanged" ></asp:TextBox>
            <asp:Label ID="lbPass1" runat="server"></asp:Label>
        </td>
    </tr>
     <tr>
        <td class="style8">
            enter password Again</td>
        <td class="style6">
            <asp:TextBox ID="txtPass2" runat="server" AutoPostBack="True" 
                ontextchanged="txtPass2_TextChanged" ></asp:TextBox>
            <asp:Label ID="lbpass2" runat="server"></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style8">
            Full name</td>
        <td class="style6">
            <asp:TextBox ID="txtFullname" runat="server" AutoPostBack="True" 
                ontextchanged="txtFullname_TextChanged"></asp:TextBox>
            <asp:Label ID="lbFullname" runat="server"></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style8">
            Email</td>
        <td class="style6">
            <asp:TextBox ID="txtEmail" runat="server" AutoPostBack="True" 
                ontextchanged="txtEmail_TextChanged"></asp:TextBox>
            <asp:Label ID="LbEmail" runat="server"></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style8">
            Gender</td>
        <td class="style6">
            <asp:RadioButtonList ID="rdlGender" runat="server" 
                RepeatDirection="Horizontal" AutoPostBack="True" 
                onselectedindexchanged="rdlGender_SelectedIndexChanged">
                <asp:ListItem>Famale</asp:ListItem>
                <asp:ListItem>Male</asp:ListItem>
            </asp:RadioButtonList>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="lbGender" runat="server"></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style4">
            Birthdays</td>
        <td class="style7">
            <asp:TextBox ID="txtBrithday" runat="server"></asp:TextBox>
            <asp:ImageButton ID="ImageButton1" runat="server" onclick="ImageButton1_Click" 
                Height="23px" ImageUrl="~/icon/canlendar.jpg" Width="60px" />
            <asp:Calendar ID="Calendar1" runat="server" Visible="False" Height="200px" 
                onselectionchanged="Calendar1_SelectionChanged" Width="220px" 
                BackColor="White" BorderColor="#3366CC" BorderWidth="1px" CellPadding="1" 
                DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" 
                ForeColor="#003399">
                <SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                <SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
                <WeekendDayStyle BackColor="#CCCCFF" />
                <TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
                <OtherMonthDayStyle ForeColor="#999999" />
                <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" />
                <DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" />
                <TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px" 
                    Font-Bold="True" Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" />
            </asp:Calendar>
        </td>
    </tr>
    <tr>
        <td class="style4">
            PhoneNumber</td>
        <td class="style7">
            <asp:TextBox ID="txtPhone" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="style4">
            Address</td>
        <td class="style7">
            <asp:TextBox ID="txtAddress" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="style4">
            Image</td>
        <td class="style7">
            <asp:FileUpload ID="fulImage" runat="server" />
        </td>
    </tr>
    <tr>
        <td class="style4" align="right">
            <asp:Button ID="btnAdd" runat="server" Text="Add" onclick="btnAdd_Click" 
                style="height: 26px" />
        </td>
        <td class="style7">
            <asp:Button ID="btnCancel" runat="server" Text="Cancel" 
                onclick="btnCancel_Click" />
        </td>
    </tr>
</table>
</asp:Content>

